import org.junit.Assert;
import java.util.Arrays;
public class NGuessNumberTest {


    @org.junit.Test
    public void generateAnswerTest(){
        NGuessNumber nGuessNumber = new NGuessNumber();
        int[] num = nGuessNumber.generateAnswer();
        System.out.println(Arrays.toString(num));
        Assert.assertEquals("答案数量不对",num.length,4);
        Assert.assertEquals("存在重复",num.length,4);
        Assert.assertEquals("最大数字超过9",Arrays.stream(num).max().getAsInt() <= 9 ? 0 : 2,0);
    }


    @org.junit.Test
    public void getPlayerInputTest() {
        NGuessNumber nGuessNumber = new NGuessNumber();
        int[] num = nGuessNumber.getPlayerInput();
        Assert.assertEquals("输入数量不对",num.length,4);
    }


}
